package com.RecipeBook.common;

import java.util.HashMap;
import java.util.Map;

public class RecipeInProgress {
	
	private Recipe recipe;
	
	public RecipeInProgress(Recipe recipe) {
		this.recipe = recipe;
	}
	
	public Recipe getRecipe(){
		return recipe;
	}
	
	public int getCurrentStep() {
		int count = 0;
		for (RecipeStep s : recipe.getSteps()) {
			if (s.isCompleted())
				count++;
		}
		return count;
	}
	
	public void checkStep(int number) {
		RecipeStep s = recipe.getSteps().get(number);
		s.setCompleted(!s.isCompleted());
	}
	
	public int getTotalSteps() {
		return recipe.getSteps().size();
	}
}
